import HTTP from '@/libs/http'
class MapApi extends HTTP {
  /**
   * @description: 获取网格范围--地图绘制网格
   * @author cx
   * @param gridCode String 网格编码 多个用逗号隔开
   * @date 2021.11.12
   */
  gridScope({ gridCode }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/gridScope',
      params: { gridCode }
    })
  }

  /**
   * @description: 根据网格编码获取楼栋
   * @author cx
   * @param gridCode String 网格编码 多个用逗号隔开
   * @date 2021.11.12
   */
  build({ gridCode }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/build',
      params: { gridCode }
    })
  }

  /**
   * @description: 辖区网格内登记数量
   * @author cx
   * @param gridCode String 网格编码 多个用逗号隔开
   * @date 2021.11.12
   */
  gridRegisterCount({ gridCode }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/gridRegisterCount',
      params: { gridCode }
    })
  }

  /**
   * @description: 单元统计
   * @author cx
   * @param buildCode String 楼栋编码
   * @param unit String 单元号
   * @date 2021.11.12
   */
  unitStatistic({ buildCode, unit }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/unitStatistic',
      params: { buildCode, unit }
    })
  }

  /**
   * @description: 获取楼栋单元
   * @author cx
   * @param buildCode String 楼栋编码
   * @date 2021.11.12
   */
  unit({ buildCode }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/unit',
      params: { buildCode }
    })
  }

  /**
   * @description: 获取楼栋单元
   * @author cx
   * @param buildCode String 楼栋编码
   * @param unit String 单元号
   * @date 2021.11.12
   */
  unitName({ buildCode, unit }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/app/grid/map/unitName',
      params: { buildCode, unit }
    })
  }

  /**
   * @description: 获取事件列表
   * @author cx
   * @date 2021.11.15
   * @param {String} eventStatus 事件状态
   * @param {String} eventDescription 根据事件标题和内容搜索
   * @param {Int} recordSize 开始下标（第一条数据的下标为0）
   * @param {Int} pageSize 每页显示条数
   */
  eventList({ eventStatus, eventDescription, recordSize, pageSize }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-app/all_event/list',
      params: {
        eventStatus,
        eventDescription,
        recordSize,
        pageSize
      }
    })
  }
}
class BuildApi extends HTTP {
  /**
   * @description: 房屋使用形式
   * @author cx
   * @param buildCode String 楼栋编码
   * @param unit String 单元号
   * @date 2021.11.12
   */
  usehouse({ buildCode, unit }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/build/usehouse',
      params: { buildCode, unit }
    })
  }

  /**
   * @description: 房屋详情
   * @author cx
   * @param houseCode String 房屋编码
   * @date 2021.11.12
   */
  housedetail({ houseCode }) {
    return this.request({
      method: 'GET',
      url: '/smart/smart-government-statistic/build/housedetail',
      params: { houseCode }
    })
  }
}
class GridMapApi {
  constructor() {
    this.Map = new MapApi()
    this.Build = new BuildApi()
  }
}

const GridMap = new GridMapApi()
export default GridMap
